import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        System.out.println("请输入您给定的范围：");
        Scanner scanner=new Scanner(System.in);
        String s=scanner.nextLine();

        String[] arr=s.split(" ");
        int L=Integer.parseInt(arr[0]);//2
        int R=Integer.parseInt(arr[1]);//22

        ArrayList<Integer> list=new ArrayList<>();

        if (L<=1000 && L>=1 && R<=1000 && R>=1 ){
            for (int i = L; i <= R; i++) {
                //02 12 20 21 22
                if (i%10==2 || i/10==2){
                    list.add(i);
                }
            }
        }
        System.out.println(list.size());

    }
}
